import React from 'react';
import {
  Scene,
  Actions,
  Lightbox,
  Overlay,
  Stack,
} from 'react-native-router-flux';
import CardStackStyleInterpolator from 'react-navigation-stack/dist/views/StackView/StackViewStyleInterpolator';

import {
  demo,
  splash,
  home,
  webViewScreen,
  speechSearch
} from '../screens'

const overlay = Actions.create(

  <Overlay key="overlay">
    <Lightbox key="lightbox">
      {/* 正常呈现第一个场景 */}
      <Stack hideNavBar
        key="root"
        titleStyle={{ alignSelf: 'center' }}
        transitionConfig={() => ({ screenInterpolator: CardStackStyleInterpolator.forHorizontal })}
      >

        <Scene back={false} component={splash} initial key="splash" />
        <Scene back={false} component={home} key="home" />

        <Scene back={false} component={demo} key="demo" />

        <Scene back component={speechSearch} key="speechSearch" />
        <Scene back component={webViewScreen} key="webViewScreen" />
      </Stack>
      {/* 模态，允许调整大小和背景的透明度 */}
      {/* <Scene key='receiveRedEnvelopes' component={ReceiveRedEnvelopes} hideNavBar />*/}
    </Lightbox>
  </Overlay>
)
export default overlay
